<?php


namespace App\Admin\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class GeoModel extends Model
{ 
     protected $table = 'geo';
     
     public function __construct() {
         $this->timestamps = false;
     }
     public function store(Request $request){
         var_dump($request->get('latitude'));
     }
     public function getPoints($id=0,$point,$limit=10){
         $map = array(
             'projectid' => $id
         );

         return DB::table($this->table)->where($map)->where(function($query) use($point){
             if($point){
                 $query->where('title', 'like', '%'.$point.'%');
             }
         })->paginate($limit);
//         return DB::table($this->table)->where('projectid',$id)->select()->get();
     }
}
 
   
